package main

import (
	_ "hello/controllers/admin"
	_ "hello/models"
	_ "hello/routers"

	"github.com/beego/beego/v2/client/orm"
	beego "github.com/beego/beego/v2/server/web"
)

func init() {

	// need to register models in init

	// need to register default database
	orm.RegisterDataBase("default", "mysql", "root:123456@tcp(127.0.0.1:3306)/beego?charset=utf8")

	// automatically build table
	orm.RunSyncdb("default", false, true)
}

func main() {
	beego.Run()
}
